<?php

class DateTimePicker extends TTemplateControl
{
	public function setDateTime($date_time)
	{
		$parser = new DateTimeParser($date_time);
		$this->date->setDate($parser->getDate());
		$this->time->setTime($parser->getTime());
	}
	
	public function getDate()
	{
		return $this->date->getDate();
	}
	
	public function getTime()
	{
		return $this->time->getTime();
	}
	
	public function getDateTime()
	{
		return $this->getDate().' '.$this->getTime();
	}
	
	public function getDatePicker() {
		$this->ensureChildControls();
		return $this->getRegisteredObject('date');
	}
	
	public function getTimePicker() {
		$this->ensureChildControls();
		return $this->getRegisteredObject('time');
	}
}

?>